函数声明一般是这样: int fun(int, double); 对应函数指针(pointer to function)的声明是这样: int (*pf)(int, double); 可以这样使用: pf = &fun; ? ?
基于4个网页-相关网页
cast and pointer to function 强制和指向函数的指针
pointer to function linkage 指针
pointer to member function 成员函数指针 ; 成员函数指标 ; 成员函式指标 ; 成员指标
and pointer to function 和指向函数的指针
An array is converted to a pointer to the type of the array; a function is converted to the appropriate pointer to function type.
将数组转换为指向数组类型的指针,将函数转换为指向函数类型的适当指针。
The reason C and C++ never adopted nested functions is because in order to make capture work, you need additional information, with the result that a pointer to function becomes more complex.
C和c++的原因从未采用嵌套函数是因为为了使捕获的工作,你需要额外的信息,其结果是一个指针函数变得更加复杂。
It returns a pointer to the function, which can then be used like any other reference value.
它返回一个函数指针,可以像任何其他引用值一样使用它们。
应用推荐